﻿<UserControl x:Class="Dubs_Finder.View.DubsViewUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <DockPanel>
        <ListView ItemsSource="{Binding DubsWrapper}" SelectionMode="Single" Focusable="False" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="30" >
                        <CheckBox Checked="selectAll" Unchecked="unselectAll"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox Focusable="False" IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="120" Header="File Name" x:Name="DVFileNameCol">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextTrimming="CharacterEllipsis" Text="{Binding FileName}"
                                           IsMouseDirectlyOverChanged="TextBlock_IsMouseDirectlyOverChanged">
                                    <TextBlock.ToolTip>
                                        <ToolTip Visibility="Collapsed">
                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                        </ToolTip>
                                    </TextBlock.ToolTip>
                                </TextBlock>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="60" Header="Dublicants" DisplayMemberBinding="{Binding NumDubs}" />
                    <GridViewColumn Width="60" Header="File Size" DisplayMemberBinding="{Binding Size}" />

                </GridView>
            </ListView.View>
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_PreviewMouseLeftButtonDown" />
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>
    </DockPanel>
</UserControl>
